<?php
namespace api\modules\v1\models\report;

use common\models\Functions;
use common\models\Status;
use yii\base\Exception;
use yii\helpers\ArrayHelper;

/**
 * This is the model class for table "goods".
 *
 * @property int $id
 * @property string $name
 */
class ReportCategory extends \common\models\report\ReportCategory
{

    public function getCategory() {
        try {
            $where["status"] = Status::COMMON_RADIO_YES;
            $where["is_delete"] = Status::COMMON_IS_NOT_DELETE;
            $list = static::getByWhere($where, ["id", "name"]);


            return Functions::formatRestAPI(0, '', $list);
        } catch (Exception $e) {
            return Functions::formatRestAPI(1, $e->getMessage());
        }
    }
}
